package com.boot.project;

import java.io.File;
import java.util.Random;

public class Constance {
    // 首页轮播资讯类型
    public static Integer indexRotation = 1;
    // 订场轮播资讯类型
    public static Integer bookRotation = 1;
    // 少儿轮播资讯类型
    public static Integer childRotation = 1;
    // 首页下拉分页资讯类型
    public static Integer indexList = 1;
    // 首页轮播资讯类型
    public static Integer childList = 1;

    // 图片上传的路径文件夹
    public static String uploadPath = "C:" + File.separator + "upload";

    // 生成随机码的方法
    public static String rangeCode() {
        String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
        Random random = new Random();
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < 9; i++) {
            int num = random.nextInt(str.length());
            char charAt = str.charAt(num);
            sb.append(charAt);
        }
        String rangeCode = sb.toString();
        return rangeCode;
    }
}
